/*  ----------------------------------------------------------------------------
 *  Arello Mobile
 *  Fast 3d Engine
 *  ----------------------------------------------------------------------------
 * Except where otherwise noted, this work is licensed under
 * http://creativecommons.org/licenses/by/3.0
 */

#include "Finder.h"
#include "FileSystem.h"

namespace liba
{
namespace filesystem
{

bool create_directory_tree(const filesystem::String & path)
{
	filesystem::String::iterator cit = path.begin();
	if( cit == path.end() )
		return true;
	filesystem::String part = *cit++;
	while( cit != path.end() )
	{
		char cmd[4096];
		sprintf(cmd, "mkdir \"%s\"", part.c_str() );
		system(cmd); 

		part += "/";
		part += *cit++;
	}
	return true;
}

} // namespace converter
} // namespace liba

